diff --git a/Makefile.am b/Makefile.am
index cc44166..7212ada 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,8 +43,8 @@ OT_INTERNAL_SOUP_CFLAGS = $(OT_DEP_SOUP_CFLAGS)
 OT_INTERNAL_SOUP_LIBS = $(OT_DEP_SOUP_LIBS)
 
 # This canonicalizes the PKG_CHECK_MODULES or AM_PATH_GPGME results
-OT_INTERNAL_GPGME_CFLAGS = $(OT_DEP_GPGME_CFLAGS) $(GPGME_CFLAGS)
-OT_INTERNAL_GPGME_LIBS = $(OT_DEP_GPGME_LIBS) $(GPGME_LIBS)
+OT_INTERNAL_GPGME_CFLAGS = $(OT_DEP_GPGME_CFLAGS) $(GPGME_PTHREAD_CFLAGS)
+OT_INTERNAL_GPGME_LIBS = $(OT_DEP_GPGME_LIBS) $(GPGME_PTHREAD_LIBS)
 
 if BUILDOPT_INTROSPECTION
 include $(INTROSPECTION_MAKEFILE)
diff --git a/configure.ac b/configure.ac
index b5bc1e5..0ad07e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,13 +106,13 @@ AM_CONDITIONAL(BUILDOPT_INTROSPECTION, test "x$found_introspection" = xyes)
 
 LIBGPGME_DEPENDENCY="1.1.8"
 
-PKG_CHECK_MODULES(OT_DEP_GPGME, gpgme >= $LIBGPGME_DEPENDENCY, have_gpgme=yes, [
-    m4_ifdef([AM_PATH_GPGME], [
-       AM_PATH_GPGME($LIBGPGME_DEPENDENCY, have_gpgme=yes, have_gpgme=no)
+PKG_CHECK_MODULES(OT_DEP_GPGME, gpgme-pthread >= $LIBGPGME_DEPENDENCY, have_gpgme=yes, [
+    m4_ifdef([AM_PATH_GPGME_PTHREAD], [
+       AM_PATH_GPGME_PTHREAD($LIBGPGME_DEPENDENCY, have_gpgme=yes, have_gpgme=no)
     ],[ have_gpgme=no ])
 ])
 AS_IF([ test x$have_gpgme = xno ], [
-   AC_MSG_ERROR([Need GPGME version $LIBGPGME_DEPENDENCY or later])
+   AC_MSG_ERROR([Need GPGME_PTHREAD version $LIBGPGME_DEPENDENCY or later])
 ])
 OSTREE_FEATURES="$OSTREE_FEATURES +gpgme"
 
