Small build fixes

A branch with small build fixes; slightly updated.  These are preliminary changes for more substantial Makefile reworking later on.