Jamming transition in granular media: A mean-field approximation and numerical simulations