restructure main makefiles

to comply with default rules