MEX: Makefile overhaul

* create *.o files in separate step (and re-use them)
* create *.o files in current directory
* (slightly) improve passing of options to mex-compiler