Support open-prefix for mpic++ and serious bugfix for mpi ldflags/cflags detection (thanks to Hiroshi Umemoto)