When dealing with units that are a bit obscure, just write it out so you don't get confused and cancel units as you go.
Let x be the rate at which bolts are made
x bolts/minute = n bolts / 5 minutes . . . 1
x bolts/minute = 2400 bolts / 60 minutes . . . 2
Equate 1 and 2 to get;
n/5=2400/60
=40
n=200 bolts
The main thing you forgot is that the units on both sides of an equation need to be equal, otherwise the terms themselves can't possibly be equal (except for multiples of units such as grams and kilograms of course). If you're only given two pieces of information like in this case, make a 'dummy' term such as the x I had which is effectively just something which cancels out any units. Using your working out, this thought process might be more along the lines of;
n bolts~5 minutes
n bolts/y bolts=5 minutes/z minutes (units 'cancel out' now)
n/y=5/z
and then merge the constants y and z and transpose to become x to get
n/5=x
Of course this is purely for explanatory reasons and isn't something you'd write in an exam, but I'm just trying to show how you could come up with such a process and the reasons behind it.