https://bugs.gentoo.org/show_bug.cgi?id=418447

--- a/build/Makefile.test
+++ b/build/Makefile.test
@@ -44,8 +44,8 @@
     USE_PROXY_FLAG = $(DEFINE_KEY)HARNESS_USE_PROXY
     CPLUS_FLAGS += $(USE_PROXY_FLAG)
     LINK_TBB.LIB = $(PROXY.LIB)
-    LIBS += $(LIBDL)
-endif
+endif
+LIBS += $(LIBDL)
 
 TEST_SUFFIXES=secondary compiler_builtins pic
 include $(tbb_root)/build/common_rules.inc
