Better directory selecting.

Also updated to better handle empty/default make targets.