Link programs with pthread via cmake

All programs are now linked directly with all test code, thus adding a
pthread abstraction into the test code means having to link the programs
with pthread (if the library is found under cmake).

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
diff --git a/programs/fuzz/Makefile b/programs/fuzz/Makefile
index b4fc76a..3b9b50d 100644
--- a/programs/fuzz/Makefile
+++ b/programs/fuzz/Makefile
@@ -29,6 +29,10 @@
 
 ifdef WINDOWS_BUILD
 LOCAL_LDFLAGS += -lbcrypt
+else
+ifeq ($(THREADING),pthread)
+LOCAL_LDFLAGS += -lpthread
+endif
 endif
 
 # A test application is built for each suites/test_suite_*.data file.