Another question if you can clarify: did this error happen when you compile MBX or compiling lammps? Assuming your error occurs during lammps compilation, here’s something you may attempt first: in the Makefile.mpi_mbx, add
LIB += $FFTW_HOME/lib/libfftw3f.a
LIB += $FFTW_HOME/lib/libfftw3.a
this may or may not work.
Sharing the config.log file will still be helpful.