You should be able to repair anvils by crouching then clicking them with an iron ingot similar to iron golems