To do this recount, you can just run this simple script in your DB. I did write and use it when I've moved my forum from phpBB to yaf.
This will not only update you forum counters, but also fix any "last post" and "last topic" if broken.
use [your_database]
-- Update users counter
update yaf_User set
NumPosts =
(select count(*) from yaf_Message where yaf_Message.UserID = yaf_User.UserID)
-- Update topics counter and last posts
update yaf_Topic set
LastPosted =
(select top(1) yaf_Message.Posted from yaf_Message where yaf_Message.TopicID = yaf_Topic.TopicID order by Posted desc),
LastMessageID =
(select top(1) yaf_Message.MessageID from yaf_Message where yaf_Message.TopicID = yaf_Topic.TopicID order by Posted desc),
LastUserID =
(select top(1) yaf_Message.UserID from yaf_Message where yaf_Message.TopicID = yaf_Topic.TopicID order by Posted desc),
NumPosts =
(select count(*) from yaf_Message where yaf_Message.TopicID = yaf_Topic.TopicID)
-- Update forums counters and last posts
update yaf_Forum set
LastTopicID =
(select top(1) yaf_Topic.TopicID from yaf_Topic where yaf_Topic.ForumID = yaf_Forum.ForumID order by yaf_Topic.Posted desc),
LastMessageID =
(select top(1) yaf_Topic.LastMessageID from yaf_Topic where yaf_Topic.ForumID = yaf_Forum.ForumID order by yaf_Topic.LastPosted desc),
LastUserID =
(select top(1) yaf_Topic.LastUserID from yaf_Topic where yaf_Topic.ForumID = yaf_Forum.ForumID order by yaf_Topic.LastPosted desc),
NumTopics =
(select count(*) from yaf_Topic where yaf_Topic.ForumID = yaf_Forum.ForumID),
NumPosts =
(select sum(NumPosts) from yaf_Topic where yaf_Topic.ForumID = yaf_Forum.ForumID)