A method for constructing the equation of state of a liquid and gas based on the Migdal phenomenological theory and the Benedek hypothesis