Look for gfortran before enabling support for smpif90.
(cherry picked from commit 85b2dce67ce8e0e1b4c68f6fbbf4d6f427bca3ff)