Sometimes, you don't need to open the Project Structure dialog to create a library and add it to dependencies of a module. This is the case when there are .jar files within your project content roots.
You can select such .jar files in the Project tool window and use these files to create a library. When doing so, you will be able to select the library level and the module to whose dependencies the new library should be added.
In a similar way, you can use a directory containing .jar files to create a library.
Open the Project tool window (e.g. View | Tool Windows | Project).
Select the .jar file or files to be included in the library, or a directory that contains the .jar files of interest.
Select Add as Library from the context menu.
In the Create Library dialog, specify the library name, level and the module in which this library will be used.
This solved the issue.