Yes it can navigate over the sea, with Inertial Navigation.
TERCOM is only for Vertical Navigation but it can also navigate horizontally through 3D countour modeling of the terrain providing that the modelling is entered into its data base which it should be. It then plots itself on the map and cross checks with INS and GPS or INS alone.
TERCOM, INS and GPS are completely independent but TERCOM is mainly used as a terrain radar so that the Missile, or Tornado or F-111 can adjust its altitude. It doen't follow contours just works out how high it should be and it can plot itself on a 3D model or contour map. It's a terrain following map.
Over the ocean, it simply would detect the terrain as Sea Level and adjust its altitude accordingly. If the Missile flies over the Troodhos, then the TERCOM will increase its altitude and follow the contours of the terrain so that it doesn't hit the ground until it gets over the peak and then it will follow the contours back down as it passes over the other side by decreasing its altitude.
INS is completely self contained. Inertial Nav is accurate to within a few metres, on its own.
GPS relies on a constellation of satellites for its accuracy. The US military will have pretty much dead on accuracy. Civilian use of GPS has triangulation errors which means its not as accurate and the Americans dfo that so n one can use their satellite Constellation against them (such as terrorists). But its still pretty accurate.
Cruise Missiles are not reliant on GPS alone. Even though the chances of GPS getting hacked by anyone or jammed has never happened before. If it does happen, it would cause mayhem because aircraft on RNAV Approaches would start to fly into mountains and buildings. Civil Aviation would be bought to its knees.