Generalized Edwards thermodynamics and marginal stability in a driven system with dry and viscous friction