U.S.-based oil and gas firms SM Energy and Civitas Resources said on Monday they will merge to form a $12.8 billion company.