All things considered, the South made relatively few mistakes in their defense of their territory, at least, compared to the way the Union bludgeoned their way through the war most times. That is not to say there were no mistakes, or actions that would have given them, perhaps, a better shot at that victory. Here are a few ideas:
1) The union naval blockade was everything. Britain didn't want to fully intervene, but merely buying cotton and sending military supplies, advisers and possibly financial aid would have been much more possible. This meant they should have made a more concerted diplomatic effort to get help from foreign nations, and they should have spent more money and time and effort to break the blockade, even if only in places, and even if only temporarily, to make this more possible.
2) Instead of making Pickett's Charge at Gettysburg, Lee should have withdrawn his army and moved east towards Washington DC. The Union Army would have had to follow, and then Lee could have found more favorable terrain and position to fight from. This could have affected Britain's decision to intervene or not.
3) Cavalry was the bane of the Union Army, and the South should have made it a larger portion of their forces. They couldn't outproduce or outnumber the North, so they had to be able to outmaneuver them. When they did, it was brilliantly effective. This might have put the Union armies in more disarray, and forced them to take a more cautious approach to invasion for fear their supply lines would be cut. That would allow Lee the operational freedom to take the initiative.