fixed Makefile and sourcecode for Darwin