Improve make pthread linking mechanism

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
diff --git a/tests/Makefile b/tests/Makefile
index 72429a6..29197b7 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -58,7 +58,7 @@
 EXEXT=
 SHARED_SUFFIX=
 
-ifdef PTHREAD
+ifeq ($(THREADING),pthread)
 LOCAL_LDFLAGS += -lpthread
 endif
 endif