Load is Complex (Impedance):
Load current
i L   =     VTH /(RTH + R) + j ( XTH + X )
Magnitude of load current
| iL | = VTH /(R  TH + R)2 + ( XTH + X )2
Load power PL = | iL |2 × R
= (VTH / (RTH + R)2 + ( XTH+ X )2  )× R
For getting the maximum power of PL, denominator of equation should be small.
For that select X = - Xth.
Then
PL =( (VTH )2 / (RTh+ R)2 )× R
⇒ dP/ dl =0   ⇒R = RTH
So, for maximum power factor
Z = RTH -  j X TH     = ZTH
 (Complex conjugate of ZTH)