Make sure you have installed FFTW with --enable-shared. On Ubuntu, you will also need to have libfftw3-dev installed.
--enable-shared
libfftw3-dev