Merged Makefile improvements from master