Adapt Makefile for OSX and linux