Third-order generalized Van Vleck perturbation theory study of the ground and lowest excited states of C2