cleaned up makefile structure and made them work with linux and Mac