Interesting problem. I have had to reattach soles which cames off in mid trip before. Duct tape worked fine for that.

If I had to make something from scratch, I think I would take the pockets off my backpack, stuff them with padding (grass, extra T-shirt, whatever), and tie or duct tape them to my feet - or something basically similar.

If I were beachcombing on the USA Channel Islands (where I worked for the past sixteen years or so) I would find some polypro rope - very common item on the beach - and try and weave up a pair of sandals, like the ones I have often excavated in archeological digs. That would take a little bit of time.

Often when I backpack, I carry a light pair of Aquasox for stream crossings. If I lost my shoes, I would be able to walk for a fairly good distance in those.

Of course, real men could go barefoot... This is a real alternative, but you have to prep before hand.