How to perform a phase recovery for higher order modulation schemes
This post provides many details on implementing carrier recovery for a higher order QAM system (or even QPSK).
High modulation index PSK - carrier recovery
Using a PI loop filter where in addition to a simple accumulator, a direct (proportional) path is also summed in results in a 2nd order Type 2 tracking loop as required to track phase offsets to zero error under static frequency offset conditions. Symbol-aided synchronization (where a known pilot is used) is recommended for higher order QAM to minimize acquisition time. The coefficients of the loop filter are set to stabilize the carrier recovery loop and also set the appropriate loop BW.
See this post for further considerations on setting the loop BW properly:
Loop bandwidth for symbol timing recovery