the texinfo manual still documents gpgme-config as canonical way to find gpgme. However with gpg-error 1.46 gpg-error-config is installed by default anymore, which propagates to gpgme not installing gpgme-config when built against this version of gpg-error. So the documented way does not work anymore.
Since gpgrt-config does not work unless a correct --libdir was passed (or a PKGCONFIG ebvironment variable was set) I would suggest to use refer to pkgconfig in examples like
gcc -c foo.c `gpgme-config --cflags`