+--- ./configure.ac.orig 2023-01-30 20:35:40.839847499 +0300
++++ ./configure.ac 2023-01-30 20:48:27.751778042 +0300
+@@ -838,7 +838,8 @@
+ if test "x$enable_webp" != "xno" ; then
+
+ if test "x$with_webp_lib_dir" != "x" ; then
+- LDFLAGS="-L$with_webp_lib_dir $LDFLAGS"
++ LIBS="-lpthread $LIBS"
++ LDFLAGS="-L$with_webp_lib_dir $LDFLAGS "
+ fi
+
+ AC_CHECK_LIB(webp, WebPDecode, [webp_lib=yes], [webp_lib=no],)