Quantum correlations and thermal machines