hätä keinon keksii

Etymology
lit. 'the need invents a measure'. Compare 🇨🇬.