BUILD: makefile: support THREAD_LDFLAGS

The LDFLAGS appended by USE_THREAD can now be overridden using
THREAD_LDFLAGS.
diff --git a/Makefile b/Makefile
index 63c7f78..71bd1d5 100644
--- a/Makefile
+++ b/Makefile
@@ -548,7 +548,7 @@
 endif
 
 ifneq ($(USE_THREAD),)
-  OPTIONS_LDFLAGS += -lpthread
+  THREAD_LDFLAGS = -lpthread
 endif
 
 ifneq ($(USE_BACKTRACE),)