Last class on last headline?

$count = 1; is set in the while loop, so every time the loop runs it sets to 1 again. Place it before your loop and it will work.

$count = 1; if (have_posts()) : while (have_posts()) : the_post();

Ow and the $count++ is outside the loop so it will only run after all the posts.
Change that to:

<?php $count++; endwhile; endif; ?>