diff --git a/platform.mk b/platform.mk
index f47bbffe589afe43e83a4d6e139b58f582414889..9ce10ca5482eea50af2f341c1dd1e71311db852a 100644
--- a/platform.mk
+++ b/platform.mk
@@ -78,20 +78,16 @@ endef
 
 # Find library (pkg-config)
 define find_lib
-	ifeq ($$(strip $$($(1)_LIBS)),)
-		$(1)_CFLAGS := $(shell pkg-config --cflags $(1) --silence-errors)
-		$(1)_LIBS := $(shell pkg-config --libs $(1) --silence-errors)
-	endif
-	$(call have_lib,$(1))
+	$(call find_alt,$(1),$(1))
 endef
 
 # Find library alternative (pkg-config)
 define find_alt
-ifeq ($$(strip $$($(1)_LIBS)),)
-	$(1)_CFLAGS := $(shell pkg-config --cflags $(2) --silence-errors)
-	$(1)_LIBS := $(shell pkg-config --libs $(2)  --silence-errors)
+	ifeq ($$(strip $$($(1)_LIBS)),)
+		$(1)_CFLAGS := $(shell pkg-config --cflags $(2) --silence-errors)
+		$(1)_LIBS := $(shell pkg-config --libs $(2)  --silence-errors)
+	endif
 	$(call have_lib,$(1))
-endif
 endef
 
 # Find binary