Adapt Makefile so that it can be used with IBM MPI compiler.

In particular, if IBM's `mpcc` is present, it takes precedence over OpenMPI's
`mpicc`.
Also fixed the problem of making output directory before compilation.