incorporated upstream (template) improvements to Makefile