--- a/mex/Makefile_mac
+++ b/mex/Makefile_mac
@@ -18,4 +18,42 @@
   ARCH=maci64
 endif
 
-include Makefile_unix
+ifndef DFFTW
+   DFFTW=-lfftw3
+endif
+
+ifndef SFFTW
+   SFFTW=-lfftw3f
+endif
+
+
+CFLAGS=-shared -fPIC -O3 -Wall -std=c99
+SEARCHPATHS=-I../src/thirdparty -I../src -I$(MATLABROOT)/extern/include 
+
+include filedefs.mk
+
+MEXBASE = $(MEXBASESAFE) $(MEXBASEMORE) 
+MEXS     = $(addsuffix .$(EXT),$(MEXBASE))
+
+LINKFLAGS=-L"$(MATLABROOT)/bin/$(ARCH)" \
+		  -lmex -lmx -lmwblas -lmwlapack $(DFFTW) $(SFFTW) 
+		  
+# -L../lib -l:libltfat.a does not work with clang
+LTFATLIBSTATIC=../lib/libltfat.a ../lib/libltfatf.a 
+
+# Setting relative paths 
+#LTFATLIBDYNAMIC=-L../lib -lltfat -lltfatf -Wl,-R,'$$ORIGIN/../lib'
+ 
+LTFATLIB=$(LTFATLIBSTATIC) -lc -lm 
+
+all: $(MEXS)
+
+%.$(EXT): %.c Makefile_unix config.h
+	$(CC) $(CFLAGS) $(SEARCHPATHS) -o $@ $< $(LTFATLIB) $(LINKFLAGS) 
+
+
+clean:
+	-rm *.o
+	-rm *.$(EXT)
+
+.PHONY: all clean