--- Makefile	2020-06-09 08:44:30.000000000 +0200
+++ Makefile_new	2020-06-24 07:59:18.341092160 +0200
@@ -525,18 +525,10 @@ ifneq ($(USE_REGPARM),)
 OPTIONS_CFLAGS += -DCONFIG_REGPARM=3
 endif
 
-ifneq ($(USE_DL),)
-OPTIONS_LDFLAGS += -ldl
-endif
-
 ifneq ($(USE_RT),)
 OPTIONS_LDFLAGS += -lrt
 endif
 
-ifneq ($(USE_THREAD),)
-OPTIONS_LDFLAGS += -lpthread
-endif
-
 ifneq ($(USE_BACKTRACE),)
 OPTIONS_LDFLAGS += -Wl,$(if $(EXPORT_SYMBOL),$(EXPORT_SYMBOL),--export-dynamic)
 endif
@@ -757,6 +749,14 @@ ifneq ($(USE_NS),)
 OPTIONS_OBJS  += src/namespace.o
 endif
 
+ifneq ($(USE_DL),)
+OPTIONS_LDFLAGS += -ldl
+endif
+ 
+ifneq ($(USE_THREAD),)
+OPTIONS_LDFLAGS += -lpthread
+endif
+
 #### Global link options
 # These options are added at the end of the "ld" command line. Use LDFLAGS to
 # add options at the beginning of the "ld" command line if needed.
