There are many stages to your problem, but starting is how that first dead is introduced. Deads require 2 things: mana, and time. This knowledge has application, and will be shared more explicitly below.
The more deads your opponent is able to make puts early tier unit macro in jeopardy. You can bet your last dollar if you witness the first dead, more are to come. I will not discuss any scenarios but if you do not have the force to erase this, retreat. This gives them time, but it can't be helped. This is a result from your lack of pressure and forcing his army back. If you had some army by this point, or reserved forces from an earlier struggle, you'd want to remove this dead threat right now. After all, the big question against chaos is will they go deads or wings? Honestly, that's only a reflection of your macro. If you use too many early tier units, deads. No strong range force, wings. Either way, if it can't be helped now, it's time to discuss phase two.
You know there will be more deads (or you should) at this point. So what to do? Well, there's two things. his deads may lack poison early on. He may cash that gold instead on units. If so, approach. However, the moment he starts poisoning, ABANDON LOW TIER UNITS. These are swordwraths and archidons. Why? They can't tank, and they'll succumb to poison. While SW have rage and archidons in clumps may deal good dps, deads can bing-bing-boom with poison, and with bombers on spare gold it's no joke. Don't risk it.
So what can you do? Two things. Remember, deads take mana and time. This determines when they can approach. That's the weakness. If they come in with too few deads, you can easily swarm them and eliminate them. This means you can hold the tower (given size of the stage) as long as they don't have another force to deal with you. I'm trying to stay away from hypothetical spots, but you do want that center best you can. However, plan to lose it (either now or later). He needs time though, right? Yes. But that gives you time.
If you have managed your economy, these following macros should not affect you severely. If not, then your fault is again early game. You want speartons. Juicy queues of speartons. That is your first force against deads. "But Wyzzzz, he has juggers?" I know. But he needs mana. That's WHY he has juggers. Deads cost 100 mana but use mana with each poison. So there's two things happening: he's spending money on deads and expanding his eco to father gold slots for jugs/bombers, you're busy making spears and.... merics. Why merics? Well if he's gonna need mana, you need mana to combat that. But there's a clever reason for this too.
Remember when I said deads use mana to poison? well, this means early on they can't just make medusas/marrows with that. That's why they make deads. You call it smart macro, that's really just a filler for gold. You do NOT want them receiving any more on mana, because they'll keep the flow of deads/jugs going, or perhaps get a medusa, and you're you're in a real pickle. Why? Because you eventually want a wizard. So use those merics to take the poison off, and with each meric removing poison, that's another mana cost not for you but ALSO your opponent (and they're using more deads than your merics, AND the cost is higher to poison).
However, this build as you can guess is extremely defensive. So as you managed your time and eco (right?) you've made walls and planned your c archer for another bomb/jug intrusions. When they inch you off the base (or make their way for it), you better get that wizard ready. The goal is poison them, protect with spears, and electric wall that whole clump. Use mana now on ninjas when you press forward, cause they will work for a medusa/marrow now. And if again, your economy is right, instead of more jugs (you should relax your mana to only what's needed to support wizard(2-3) and quit the speartons) focus on those giants. Why? Deads take time. And mana.