Makefile improvements

see the commit messages