Nuclear matter approach to the heavy-ion optical potential