Fix grep pattern in makealias to work on non-Gnu grep (bug 8368).
grep -l -w '^foo' doesn't work on Solaris. Replace with grep -l '^foo\>' instead which does. Also, grep -l will report the filename more than once (!), so add | head -1 to pick just the first one.