Add -pthread to extralibs and not to ldflags so that the dependency gets