Yourself is the reflexive form of you. It has many uses that you can find in the dictionary. But in your example either is correct because in 'Do it yourself' the ' by' is understood. They both mean to do it unassisted.
At least that is my take on it.
- For Teachers