refactor makefiles to avoid recursion, move sources to top level src/