--- a/configure
+++ b/configure
@@ -2661,6 +2661,10 @@ if compile_prog "" "" ; then
 elif compile_prog "" "-lrt" ; then
   LIBS="-lrt $LIBS"
   libs_qga="-lrt $libs_qga"
+# we might need -lpthread in case static linking on glibc
+elif compile_prog "" "-lrt -lpthread" ; then
+  LIBS="-lrt -lpthread $LIBS"
+  libs_qga="-lrt -lpthread $libs_qga"
 else
   echo
   echo "Error: librt check failed"
