I had a similar problem. I tried to compile charmm c41b2 edition on ubuntu 18.04 edition. The gcc edition is 7.5.0, gfortran edition is 7.5.0, and cmake edition is 3.10.2. After I typed ./configure command, I got errors in the process.

CMake Error in /home/xxx/charmm/CMakeFiles/CMakeTmp/CMakeLists.txt:
Imported target "MPI::MPI_C" includes non-existent path

in its INTERFACE_INCLUDE_DIRECTORIES.

I am wondering what I can do. Thanks.