--- a/CMake/mlpack.pc.in
+++ b/CMake/mlpack.pc.in
@@ -1,6 +1,12 @@
 Name: mlpack
 Description: scalable C++ machine learning library
 URL: http://www.mlpack.org/
+
+prefix="@CMAKE_INSTALL_PREFIX@"
+exec_prefix="${prefix}"
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
 Version: @MLPACK_VERSION_STRING@
-Cflags: @MLPACK_INCLUDE_DIRS_STRING@
-Libs: @MLPACK_LIBRARIES_STRING@
+CFlags: -I${includedir} -I${includedir}/stb
+Libs: -L${libdir} @MLPACK_LIBRARIES_STRING@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -504,26 +504,11 @@
 
   # Create the list of link directories.
   set(MLPACK_LIBRARIES_LIST)
-  foreach (linkdir ${MLPACK_LIBRARY_DIRS})
-    list(APPEND MLPACK_LIBRARIES_LIST "-L${linkdir}")
-  endforeach ()
 
   foreach(lib ${MLPACK_LIBRARIES})
     string(SUBSTRING "${lib}" 0 1 first)
-    if ("${first}" STREQUAL "/")
-      # We need to split the directory and the library.
-      string(REGEX REPLACE "(.*/)[^/]*$" "\\1" library_dir "${lib}")
-      string(REGEX REPLACE ".*/lib([^/]*)[.][a-z]*[.]*$" "\\1" library_name "${lib}")
-
-      list(APPEND MLPACK_LIBRARIES_LIST "-L${library_dir}")
-      list(APPEND MLPACK_LIBRARIES_LIST "-l${library_name}")
-    elseif ("${first}" STREQUAL "-")
-      # This argument is already in the right format.  (This happens with, e.g.,
-      # `-lpthread`.)
-      list(APPEND MLPACK_LIBRARIES_LIST "${lib}")
-    else ()
-      list(APPEND MLPACK_LIBRARIES_LIST "-l${lib}")
-    endif ()
+    string(REGEX REPLACE ".*/lib([^/]*).dll.a$" "\\1" library_name "${lib}")
+    list(APPEND MLPACK_LIBRARIES_LIST "-l${library_name}")
   endforeach ()
 
   # Filter duplicate dependencies and directories.
