When land is sold under an executory contract requiring the vendee to improve the same and such contract is forfeited or surrendered after liens have attached by reason of such improvements, the title of the vendor is subject thereto, but the vendor is not personally liable if the contract was made in good faith. When improvements are made by one person upon the land of another, all persons interested therein otherwise than as bona fide prior encumbrancers or lienors are deemed to have authorized such improvements, insofar as to subject their interests to liens therefor. Any person who has not authorized the same may protect the person's interest from such liens by serving upon the person doing work or otherwise contributing to such improvement within five days after knowledge thereof, written notice that the improvement is not being made at the person's instance, or by posting like notice, and keeping the same posted, in a conspicuous place on the premises. As against a lessor no lien is given for repairs made by or at the instance of the lessor's lessee, unless the lessor has actual or constructive notice thereof and does not object thereto.
N.D.C.C. § 35-27-07