I haven't tried the terraforming magic tree yet, but unless you were in a map corner, as mentioned above, forming a land bridge across to a nearby land mass might be an idea, as long as Magnar isn't attacking. Entering into a non-agression pact with him so he leaves you alone for 100 turns is an idea, and if you can point him at another player (Gildar bad. Kill The Gildar), so much the better.
Any chance you have a separate save game for earlier in the game, in case you'd like to go back and try something different?