Survey companies carry insurance for exactly this. If a new survey was completed recent to, or at the time of, the land purchase and the building is within the boundaries, then the survey company will be on the hook. If it is an old survey, (not sure how old, depends on the state) then this will be a mess.