In the spirit of making do while building shelter.
Imagine a foundation on only 3 sides(and a middle partition), and one on the far side has settles and slopes, losing 2 inches over 12 feet. The foundation has some sheet spalling in spots as it went thru fire, but otherwise is solid. You get a shovel and wheel barrow and remove all the ash and debris. Sweep off the foundation tops. Get some string and stakes and figure out how to square it off with a fourth side. So, how to have a foundation on the missing side ? There are various possibilities. Dry stacked rock or concrete rubble ? Rot resistant wood ? bags filled with soil ? Luckily, we still have access to some bagged concrete. That wall is 22 feet long, so we get a shovel and dig 6 "post hole" type holes, one at each end and 4 spaced out between. Once the concrete is semi hard, we gently set in something to support a rot resistant wood beam into each. When it is all set in a day, set the rot resistant wood there.
Wood is still available, scrounged and bought dear. But who can hire help these days ? And it is hard to raise walls by oneself. Here is where we need the old fashioned barn raising. Best is to find an elder who knows how it is done to instruct the process. Ancillary to this are the home improvement guides. Like, Creative Homeowner Press "Quick guide to garages and carports " or maybe one of the Sunset how to books.