Here's how to do it:
1) Go to Safari Preferences (⌘+,)
2) Select "Tabs" menu
Select the wished method. Here's how both layouts look:
Compact layout
Separate layoutl