Adding makefile and sources compatable with macos