added a pthread linking workaround for some autotools versions