diff -Nru blacs-mpi-1.1.orig//Bmake.inc blacs-mpi-1.1//Bmake.inc
--- blacs-mpi-1.1.orig//Bmake.inc	2011-08-15 21:08:36.474630178 -0700
+++ blacs-mpi-1.1//Bmake.inc	2011-08-15 21:11:41.535007658 -0700
@@ -1,4 +1,38 @@
 #=============================================================================
+#=========================== SECTION 3: COMPILERS ============================
+#=============================================================================
+#  The following macros specify compilers, linker/loaders, the archiver,
+#  and their options.  Some of the fortran files need to be compiled with no
+#  optimization.  This is the F77NO_OPTFLAG.  The usage of the remaining
+#  macros should be obvious from the names.
+#
+#  This section has been moved before Section 1 to allow redefinition of the
+#  F77 and CC options in the MPI implementation specific clauses.
+#=============================================================================
+   F77            = gfortran
+   F77NO_OPTFLAGS = $(FPIC) -w 
+   F77FLAGS       = $(F77NO_OPTFLAGS) -O4
+   F77LOADER      = $(F77)
+   F77LOADFLAGS   = 
+   CC             = cc
+   CCFLAGS        = $(FPIC) -O4
+   CCLOADER       = $(CC)
+   CCLOADFLAGS    = 
+
+#  --------------------------------------------------------------------------
+#  The archiver and the flag(s) to use when building an archive (library).
+#  Also the ranlib routine.  If your system has no ranlib, set RANLIB = echo.
+#  --------------------------------------------------------------------------
+   ARCH      = ar
+   ARCHFLAGS = r
+   RANLIB    = ranlib
+
+#=============================================================================
+#=============================== End SECTION 3 ===============================
+#=============================================================================
+
+
+#=============================================================================
 #====================== SECTION 1: PATHS AND LIBRARIES =======================
 #=============================================================================
 #  The following macros specify the name and location of libraries required by
@@ -44,6 +78,9 @@
    BLACSCINIT  = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
    BLACSLIB    = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a
 
+# Default unless overridden below:
+   CC          = cc
+
 #  -------------------------------------
 #  Name and location of the MPI library.
 #  -------------------------------------
@@ -55,13 +92,35 @@
    MPILIBdir = $(MPIdir)/lib
    MPIINCdir = $(MPIdir)/include
    MPILIB = $(MPILIBdir)/shared/libmpich.so $(MPILIBdir)/shared/libpmpich.so $(MPILIBdir)/libmpich.a
-else
+   CC = mpicc.mpich
+   F77 = mpif90.mpich
+endif
+ifeq ($(MPI),lam)
 # for compilation with lam:
    MPILIBdir = /usr/lib/lam/lib
    MPIINCdir = /usr/include/lam
    MPILIB = -L/usr/lib/lam/lib -llam
+   CC = mpicc.lam
+   F77 = mpif90.lam
+endif
+ifeq ($(MPI),openmpi)
+# for compilation with openmpi:
+   MPIdir = /usr/lib/openmpi
+   MPILIBdir = $(MPIdir)/lib
+   MPIINCdir = $(MPIdir)/include
+   MPILIB = -L/usr/lib/openmpi/lib -lmpi -lmpi_f77
+   CC = mpicc.openmpi
+   F77 = mpif90.openmpi
+endif
+ifeq ($(MPI),mpich2)
+# for compilation with mpich2:
+   MPIdir = /usr/lib/mpich2
+   MPILIBdir = $(MPIdir)/lib
+   MPIINCdir = $(MPIdir)/include
+   MPILIB = -L/usr/lib/mpich2/lib -lmpich
+   CC = mpicc.mpich2
+   F77 = mpif90.mpich2
 endif
-
 
 #  -------------------------------------
 #  All libraries required by the tester.
@@ -155,6 +214,9 @@
 ifeq ($(MPI),mpich)
    TRANSCOMM = -DUseMpich
 endif
+ifeq ($(MPI),mpich2)
+   TRANSCOMM = -DUseMpich
+endif
 
 #  If you know that your MPI uses the same handles for fortran and C
 #  communicators, you can replace the empty macro definition below with
@@ -208,33 +270,3 @@
 #=============================== End SECTION 2 ===============================
 #=============================================================================
  
-
-#=============================================================================
-#=========================== SECTION 3: COMPILERS ============================
-#=============================================================================
-#  The following macros specify compilers, linker/loaders, the archiver,
-#  and their options.  Some of the fortran files need to be compiled with no
-#  optimization.  This is the F77NO_OPTFLAG.  The usage of the remaining
-#  macros should be obvious from the names.
-#=============================================================================
-   F77            = gfortran
-   F77NO_OPTFLAGS = $(FPIC) -w 
-   F77FLAGS       = $(F77NO_OPTFLAGS) -O4
-   F77LOADER      = $(F77)
-   F77LOADFLAGS   = 
-   CC             = cc
-   CCFLAGS        = $(FPIC) -O4
-   CCLOADER       = $(CC)
-   CCLOADFLAGS    = 
-
-#  --------------------------------------------------------------------------
-#  The archiver and the flag(s) to use when building an archive (library).
-#  Also the ranlib routine.  If your system has no ranlib, set RANLIB = echo.
-#  --------------------------------------------------------------------------
-   ARCH      = ar
-   ARCHFLAGS = r
-   RANLIB    = ranlib
-
-#=============================================================================
-#=============================== End SECTION 3 ===============================
-#=============================================================================
diff -Nru blacs-mpi-1.1.orig/SRC/MPI/Makefile blacs-mpi-1.1/SRC/MPI/Makefile
--- blacs-mpi-1.1.orig/SRC/MPI/Makefile	2011-08-15 20:33:19.000000000 -0700
+++ blacs-mpi-1.1/SRC/MPI/Makefile	2011-08-15 20:34:39.870603642 -0700
@@ -194,8 +194,8 @@
 	$(F77) -c $(F77FLAGS) $*.f
 
 mpif.h: $(MPIINCdir)/mpif.h
-	rm -f mpif.h
-	ln -s $< $@
+	rm -f mpif*
+	ln -s $(MPIINCdir)/mpif* .
 
 #  ------------------------------------------------------------------------
 #  We move C .o files to .C so that we can use the portable suffix rule for
diff -Nru blacs-mpi-1.1.orig/TESTING/Makefile blacs-mpi-1.1/TESTING/Makefile
--- blacs-mpi-1.1.orig/TESTING/Makefile	2011-08-15 20:33:19.000000000 -0700
+++ blacs-mpi-1.1/TESTING/Makefile	2011-08-15 20:34:39.870603642 -0700
@@ -59,8 +59,8 @@
 	$(F77) -c $(F77FLAGS) $*.f
 
 mpif.h: $(MPIINCdir)/mpif.h
-	rm -f mpif.h
-	ln -s $< $@
+	rm -f mpif*
+	ln -s $(MPIINCdir)/mpif* .
 
 fpvm3.h : $(PVMINCdir)/fpvm3.h
 	rm -f fpvm3.h
