How did the maturing of northern manufacturing and the adherence of the south to an agricultural economy change the national economic system by 1877?