If you really love the house, investigate with the town what will be incurred in both time & money to correct the situation and what the tax impact will be and then deduct that amount from your offer.
the other option is see if they will do an escrow closing. You will take on the headache of the C of O's, but a certain amount of $ will be held in escrow and not released until everything is approved, no further work is necessary and the permits are received.
If it does not work out consider this...when it's meant to be it will be! I wish you luck :-)