diff --git a/bob/extension/boost.py b/bob/extension/boost.py
index b5045a87dca569a507d2ce3378fd40fdba0c82c1..8236c82f84e58676e83034e21c2f73ef92007c39 100644
--- a/bob/extension/boost.py
+++ b/bob/extension/boost.py
@@ -103,8 +103,7 @@ class boost:
 
 
   def libconfig(self, modules, only_static=False,
-      templates=['boost_%(name)s-mt-%(py)s',
-        'boost_%(name)s-mt', 'boost_%(name)s']):
+      templates=['boost_%(name)s-mt-%(py)s', 'boost_%(name)s-%(py)s', 'boost_%(name)s-mt', 'boost_%(name)s']):
     """Returns a tuple containing the library configuration for requested
     modules.