Restructured and created dynamic Makefiles