Makefile improvements.

These changes came "Upstream" from the "official" code in my personal
Subversion repository.