Added missing pthread linkage in tests