I am under siege and walled in, what can I do to fight back?

Solution 1:

By the looks of it, your fortress isn't in an evil region and therefore you aren't dealing with evil weather undead, but regular undead, which are susceptible to all forms of damage (piercing, slashing, crushing) - archers will take care of them just fine, provided there isn't a necromancer to reanimate the bodies. Traps remain the safest option to deal with most foes, but are rather boring. Slashing traps and weapons, however, are far from boring if a necromancer is around, turning one zombie into a bunch of individual zombie bits. If you're certain there isn't a necromancer around, you can just take them in melee combat or do any number of things to them (hell, make a zoo out of them) except killing them with magma (but you can make an undead magma zoo). If there is a necromancer, I would suggest annihilating them with drawbridges or containing them with cage traps, to make sure they can't be raised again. You can also use cage traps to catch a necromancer (drawbridge annihilation isn't easy to do if the enemy is hidden, which necromancers are, initially), but keep in mind that they will raise dead even from inside a cage.

If they breach your fort and you don't believe you have the strength to defeat them in combat, walling yourself off and preparing may be a good solution. You can use burrows to get your dwarves all in the same place. If they happen to occupy an important part of your fortress, you can get them to move by chaining an animal in a long tunnel/maze and giving them a path to it, then walling them inside.