refactored makefiles