I second Chris M’s suggestion.

It is generally recommended by “the experts” that you limit principal navigation to between five and nine choices. It’s not just that having 40 options makes the page look overwhelming (to put it kindly), but that it will almost certainly discourage users from spending time on the page. They’ll give up looking and move on to someone else’s site.

It would be wise to use submenus or even to make subcategories available not directly through the main page, but through pages that are reached from it.

Good luck.