As I understood, when a client connects through Tor he connects to the central Tor servers, picks up three (or more) public keys, connects to the first, makes a chain to the second and makes a chain to the third. This is the only way to prevent a Tor entry node from being an entry node, middle node and exit node.
Now what happens if a certain three letter agency gets access to the Tor server? If they want to spy on a particular person (who's IP is known), the Tor directory server (now under their control) just sends them three public keys of servers anonymously under control of a three letter agency.
Now they know everything.
Note, even self compiling (after analyzing source code) won't help, as the hack is on the server + a three letter agency can enforce gag-orders.