Added fixes to CMake-based system, when building pnetcdf.