Lots of Makefile changes to make the program more portable.