fixed makefile to work with mac OSX
fixed merge conflicts