Use CMake to configure netcdf.

Patch the CMakeLists.txt first.