This indicates a PATH issue.  I'd much rather put the the MPI compilers properly on the PATH than hardcode the variables for each compiler in with additional logic.