ATmega 32 Clock Frequency Issue
You cannot use _delay_ms to wait for that long. According to the AVR GCC description of the function:

The maximal possible delay is 262.14 ms / F_CPU in MHz.
When the user request delay which exceed the maximum possible one, _delay_ms() provides a decreased resolution functionality. In this mode _delay_ms() will work with a resolution of 1/10 ms, providing delays up to 6.5535 seconds (independent from CPU frequency). The user will not be informed about decreased resolution.

Also, you should check that you set CLKDIV8 and CLKSEL correctly for your system.