A modified Marchenko method to retrieve the wave field inside layered metamaterial from reflection measurements at the surface