All thunderstorms produce lightning, by definition.
If you can hear thunder, you are close enough to the storm to be struck. These lightning strokes come out of the upper portions of the thunderstorm cloud which extends 5 to 10 miles into the atmosphere. In general, lightning will travel the easiest route from the cloud to ground which means that it often strikes the tallest object. Therefore, a simple rule is to not make yourself the tallest object or stand near the tallest object in your immediate surrounding. For instance, do not stand in an open field, on a beach, or on a hilltop.