add thread-related CFLAGS needed on some platforms