I'm not familiar with Ubuntu's Network Manager. You can always disable that using:
sudo service network-manager stop
Then use:
sudo iwlist wlan0 scanning | grep ESSID
To see if you can even see the network.
If so, and you're using wpa2, you'll have to do a few things. First generate the key/value pair that wpa_supplicant will use to connect:
sudo wpa_passphrase "mywireless_ssid" "secretpassphrase" >> /etc/wpa_supplicant.conf
Next, kill off any dhcp service (just in case it's running)
sudo pkill dhcpcd
Finally, try to connect:
wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf &
I would maybe not fork it to the background on the first attempt, just to see if it's going to work.