I mean...a steam engine is a heat engine that uses steam to transfer heat. So you can make a steam engine by getting basically anything "really hot" and running steam through it. This is the working principle behind solar thermal power plants (but not solar panels!). I.e., you don't necessarily need coal or even a fossil fuel to build a steam engine.