Go to Window → Merge All Windows. In Safari, this merges other windows into the currently active window. In Finder, this merges the current windows into other window.
Alternatively, you can show the tab bar with View → Show Tab Bar. This lets you drag the tab when only one tab in a window is open.