as a last resort

[as a last resort] {adv. phr.} In lieu of better things; lacking better solutions.

"We'll sleep in our sleeping bags as a last resort," John said, "since all the motels are full."