On nonholonomic and vakonomic dynamics of mechanical systems with non integrable constraints