Small makefile refactoring and improvement