configure: Generalize the GMime configure checks.