cleaned up makefiles and added support for Mac and Linux