makefile update and general restructuring