In a country (Peru) where formal legal systems functioned extremely badly, there was a huge extralegal economy: houses, businesses, transport, etc all of which didn't officially exist and had no legal protection. Providing a route into the legitimate system provided a huge economic benefit for a lot of people and reduced Maoist terrorism.
Bad legal system < Lawlessness / Extralegality < Good legal system.
The book which changed my thinking the most was "The Other Path" https://www.amazon.co.uk/Other-Path-Economic-Answer-Terroris...
It would be easy to give it the traditional libertarian gloss of "reducing regulation to improve the economy", but it's much more subtle than that. It looks at the costs of being outside the "system", and the benefits of simplifying the system so as to include more people and businesses. Along with land reform to reflect the actual reality of buildings.
Also, short and entertaining, but with lots of insights into principal-agent problems and bubble mentality: "Where Are the Customers' Yachts?" https://www.amazon.co.uk/Where-Are-Customers-Yachts-Investme...