fix #2951 and cleanup some other minor Makefile annoyances