A major earthquake off Mexico's southern coast killed at least five people late on Thursday, with the president saying it was the biggest in a century to hit the country.