I am not defining capitalism as just everything bad, and capitalism is not as recent as you think. You may be thinking of industrial capitalism, which is a more recent development.
Historical Foundations of Race
American society developed the notion of race early in its formation to justify its new economic system of capitalism, which depended on the institution of forced labor, especially the enslavement of African peoples.