fix for mac by Andrey...
libs compiles and pass test on OS X

- fix the compilation of mpi.so
fixed rpath issue on mac
minor fix, details, rm debug code