Moved determination of G_THREAD_FLAGS before G_THREAD_LIBS. Check for