Refactored toplevel Makefile
Merge pull request #3348 from azmeuk/makefile

Toplevel Makefile refactoring