Fix tests makefile to link with new GNU ld linking rules

* tests/tests.am (gctest_LDADD, threadleaktest_LDADD,
threadkey_test_LDADD, subthread_create_LDADD,
initsecondarythread_LDADD): Link to pthreads (or appropriate
threading libraries) as needed; fixes failure to link with new GNU ld
linking rules.
Fix make disclaim_test to link with new GNU ld linking rules

* tests/tests.am (disclaim_test_LDADD): Link to pthreads (or appropriate
threading libraries) as needed.