Critically endangered South American forests thought to be the result of climate change were actually spread by ancient communities, archaeologists have found.