On thermodynamics of charged AdS black holes in extended phases space via M2-branes background