I've had a frustrating issue with a MacBook Air running OSX 10.7.5. Having closed the lid and travelled from work to home I' d open the machine and wait for it to find the wireless network. All to no avail - a dialogue box pops up saying "None of your preferred networks could be found" and presenting me with a list of detected networks including my home, preferred network.
Browsing through the airport documentation I eventually found the solution:
airport prefs JoinMode=Preferred JoinModeFallback=KeepLooking
Now, rather than prompting, the laptop just keeps searching for one of my preferred networks. I'd apparently been on the threshold of some timeout: the laptop now picks up my home network with no problem.