My go to method is to allow petsc to install mpi for me. Here is my usual configure line
export PETSC_DIR=<set to the location of your petsc folder>
export PETSC_ARCH=gnu
./configure --download-{parmetis,superlu_dist,openmpi,ml,hypre,metis,mumps,scalapack,blacs}