diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ccce96..1db6074 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,7 +58,7 @@ if (NOT NO_SDL2)
 		if (MSVC)
   			target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARY})
 		else()
-  			target_link_libraries(${PROJECT_NAME} -lpthread -lm ${SDL2_LIBRARY})
+			target_link_libraries(${PROJECT_NAME} -lSDL2 -lgui -ldraw -lipc -lcore -lpthread -lm -lstdc++)
 		endif()
 		add_definitions(-DUI_ENABLED)
 	else()
@@ -66,7 +66,7 @@ if (NOT NO_SDL2)
 		if (MSVC)
 			target_link_libraries(${PROJECT_NAME})
 		else()
-			target_link_libraries(${PROJECT_NAME} -lpthread -lm)
+			target_link_libraries(${PROJECT_NAME} -lgui -ldraw -lipc -lcore -lpthread -lm -lstdc++)
 		endif()
 	endif()
 else()
@@ -75,6 +75,6 @@ else()
 	if (MSVC)
 		target_link_libraries(${PROJECT_NAME})
 	else()
-		target_link_libraries(${PROJECT_NAME} -lpthread -lm)
+		target_link_libraries(${PROJECT_NAME} -lgui -ldraw -lipc -lcore -lpthread -lm -lstdc++)
 	endif()
 endif()
