Hitting a magnet with a hammer will do the opposite, it will make the magnet weaker as it makes all the small magnetic domains (see the above link) mess up and point in random directions cancelling out the magnetism.
Taku: some of the best magnets are made of ceramics, which are very brittle, so I definitely would not advise hitting them with a hammer! Designing new magnetic materials need scientists to understand how atoms fit together and interact with each other in complex three-dimensional structures.
Sorry Taku, I’ve not got a clue about magnets, and I’m not going to try and make anything up about them! You could do a Google search and try and read up a bit more about them. There must be loads online for you to read, with pictures too, which would probably help to make sense of it (it definitely helps me to see pictures and visualise things).
The best way of making magnets stronger is to cool superconducting wires down to -271 degrees. At this point they nearly no resistance. You can then wrap these wires around a tube, a million or so times and you have a very powerful magnet. These magnets are used in MRI machines, to image the inside of animals and humans. The one I use is 7,000 times stronger than a fridge magnet.