BUILD: Makefile: use -pthread not -lpthread when threads are enabled

-pthread is normally the right way to enable threads, it involves -lpthread
at the end of the arguments, and also enables -D_REENTRANT=1. We normally
don't care about the subtle difference, but building with a static openssl
library that has threads enabled breaks because -lpthread is placed before
the SSL_LDFLAGS and openssl doesn't find pthread_atfork().

Let's change the flag to -pthread once for all, that's something we've
considered over the last decade without having a good reason to do it
since it didn't bring any value. Now at least it fixes a build issues,
this is a good reason. This doesn't need to be backported since it is
one of the consequences of the new more flexible build options in 2.8.
diff --git a/Makefile b/Makefile
index 3b1ff10..11096c2 100644
--- a/Makefile
+++ b/Makefile
@@ -554,7 +554,7 @@
 endif
 
 ifneq ($(USE_THREAD),)
-  THREAD_LDFLAGS = -lpthread
+  THREAD_LDFLAGS = -pthread
 endif
 
 ifneq ($(USE_BACKTRACE),)