Fixes for gfortran and for existing system libatm