U.S. markets rose slightly on Monday after giving up early gains as stocks sought to bounce back from losses in the first week of trading for June.