Provide a way for OS X users to indicate a preference for the GMP framework

We used to always use the framework if it existed. Now the make variable
GMP_PREFER_FRAMEWORK can be used to control whether the library or the
framework is preferred.

Fixes #7466.
Fix configure when we don't have a gmp library