In general you have to increase the Miller cap untill you have enough phase margin, but there is a problem with right half plane zero (if cap large enough and gm too small). Very good explanation on frequency compensation is in the book Analog Integrated Circuit Design by David Johns , Ken Martin, p.221