This seems like the wrong place in configure.ac to put this check -- you put this OSHMEM check right in the middle of the libtool setup code (the Fortran check here is part of the libtool setup; see the comment right before that in configure.ac that describes what's going on).

Why not put the OSHMEM check way up near/after the call to setup the Fortran MPI stuff?