(1) After the time when a commission has adopted a major street plan of the territory within the municipal limits of said municipality, no building shall be erected on any lot within such territory or part nor shall a building permit be issued therefor unless the street giving access to the lot upon which such building is proposed to be placed:
(a) Has been accepted or opened as or otherwise has received the legal status of a public street prior to that time; or
(b) Corresponds with a street shown on the official master plan, with a street or subdivision plat approved by the planning commission, with a street on a street plat made by and adopted by the commission, or with a street accepted by the governing body in accordance with the provisions of section 31-23-217. Any building erected in violation of this section is an unlawful structure, and the building inspector or other appropriate official may cause it to be vacated or have it removed.