Sounds to me like one of the following:
- faulty or excessively long wiring
- bad power supply
- you have something else connected to one of the MISO, MOSI and SCLK pins that is interfering with programming
If it's a home-made board, the following might also be causing the problem:
- wrong value capacitors connected to the crystal pins of the atmega168 or no capacitors connected
- no decoupling capacitor between atmega168 Vcc and ground pins