How did the American civil war affect America’s society in the late 19th century?