I would say you can replace the rim, but its a pain in the butt job, and its also obvoius this tank was used as some type of reptile enclosure. It appears very old and well used. you would be much safer to find a different tank then take the risks.
Petco has a sale for a dollar per gallon for up to 55 gallon tanks. Start there.