bugfix in build_ext: check that ext has an attribute before trying to
use it
 reduces excess cleverness from 1/2 to 1/3
Merge pull request #3261 from keflavich/f77_ext_bugfix

bugfix in build_ext: check that ext has an attribute before trying to us it