sp_dboption [database], 'single user', false
(When you are not the user who has it locked. Or, if a connection was lost)
If the above doesn't work, and/or, you get a deadlock (with yourself), close and relaunch SSMS and then use the following:
ALTER DATABASE [dbname] SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE [dbname] SET MULTI_USER