A version of the Glimm method based on generalized Riemann problems