This is my guide to playing Veigar and getting max AP, so you can crush your opponents. Keep in mind that I only play 3v3, so as far as 5v5 goes, GL and I hope the same situation can apply.
This build is Strictly for tower hugging, while farming and heavily avoiding ganks, and also running around with your team and ganking, not for pushing, or 2v1 (the 1 being veigar)! The goal with this build is to safely gather a decent amount of AP, then start joining team battles and staying long range and smiting from a distance, and running if needed, (ghost and event horizon)
Sell Doran's Ring to get Zhonya's Ring.
Turn Boots Of Speed into Sorcerer's Shoes.
They are in this order for a reason. By the time you are getting Zhonya's Ring, you wont need Doran's Ring. As for the boots, you only need a little help with running, because ghost usually does it for you, but later having the extra movement and magic penetration helps.
If you can solo a lane, please do. What you want to do is time your baleful strike to get the last hit on EVERY minion that you can. Trust me, by the time you start ganking you will have a good extra 50 AP. And make sure that throughout the entire game, that you are using baleful strike to finish a minion, or enemy hero. Try to start abusing and ganking right when you get Mejai's Soulstealer, because after 20 points (10 kills, or 20 assists, or a combination of the 2) you will have about 1000 AP, if you also farmed with baleful strike. Stay away from enemy heroes without mana, since your ult will be useless untill you get a good 500 AP, but keep in mind that your other 3 moves can still heavily hit any enemy.