The three major stock indexes in the United States ended the month with significant losses as the Nasdaq Composite finished its worst month since October 2008.