In the page of prerequisites, section Ubuntu, optional packages (sudo apt-get …), the package cfitsio-dev is not found by the package manager. It should read, at least for ubuntu 16.04, libcfitsio-dev.
Maybe, “cmake” should be added also in the list of required packages.