Do you have another MPI installation on your system or is there an MPI library bundled with WRF? Based on the error messages you are seeing, I believe that your linker is finding a libmpi.a or libmpi.so that is not from the Intel MPI Library first. Check your LD_LIBRARY_PATH variable and all paths listedin the link line before /opt/intel/impi/4.0.1.007/intel64/lib for any other MPI libraries. If this is the case, I would recommend either adding the library path for the Intel MPI Library to the beginning of your LD_LIBRARY_PATH variable or rearranging the link line to have it appear before the other MPI library.
Sincerely, James Tullos Technical Consulting Engineer Intel Cluster Tools
If you are building and running with ifort and Intel MPI, you must use (only) the mpiifort compiler wrapper. mpif90 which comes with Intel MPI uses gfortran. Either of those will supply automatically the appropriate MPI headers and libraries, but you can't mix ifort and gfortran libraries. You must not specify linkage against libraries associated with another MPI. It looks like you are mixing a makefile intended for some other MPI with the setup for Intel MPI. Perhaps one of the articles on building WRF with Intel tools may help, even if it's out of date. You will find several if you enter WRF in the "product index" search window.