diff --git a/ext/commonmarker/extconf.rb b/ext/commonmarker/extconf.rb
index <HASH>..<HASH> 100644
--- a/ext/commonmarker/extconf.rb
+++ b/ext/commonmarker/extconf.rb
@@ -18,6 +18,7 @@ Dir.chdir(CMARK_BUILD_DIR) do
   system 'make'
 end
 
+$LDFLAGS << " #{CMARK_BUILD_DIR}/src/libcmark.#{ext}"
 $CFLAGS << " -I#{CMARK_DIR}/src -I#{CMARK_BUILD_DIR}/src"
 $LOCAL_LIBS << "#{CMARK_BUILD_DIR}/src/libcmark.#{ext}"
Include `LDFLAGS` for Linux