Try to build fftw3 without threads and gmic without fftw threads
It's optional for gmic and gmic-qt, but CImg.h demands fftw_thread_init unconditionally.