Crustose lichen (Parmeliaceae)
Not all algae lives in water.
Long ago some fungi (which is actually a predator or scavenger) engulfed some algae. It surrounded the algae but didn’t kill it. The algae kept growing inside the fungi and the fungi ate some of it and fed the rest.
From that point on it never really had to look for food again (just suck up some minerals now and again).
The fungi was perfectly waterproof and survived on land keeping its algae nice and moist inside of it.
Plants arrived and it grew on them or on the rocks that plants couldn’t grow on. Insects arrived on land, dinosaurs came and went and as humans die lichen slowly multiplies on their gravestones.
Tests show fungi can survive under Martian conditions.
Who is to say lichen did not come from another planet in the first place.