- Added automatic WINDOWS define in Makefile

diff --git a/library/Makefile b/library/Makefile
index 71e31d4..6337313 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -24,7 +24,9 @@
 # DLEXT=dylib
 
 # Windows shared library extension:
-# DLEXT=dll
+ifdef WINDOWS
+DLEXT=dll
+endif
 
 OBJS=	aes.o		arc4.o		asn1parse.o		\
 		asn1write.o								\
diff --git a/programs/Makefile b/programs/Makefile
index 8780633..3a4f729 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -11,6 +11,10 @@
 CFLAGS += -g3
 endif
 
+ifdef WINDOWS
+LDFLAGS += -lws2_32
+endif
+
 APPS =	aes/aescrypt2	aes/crypt_and_hash	\
 	hash/hello			hash/generic_sum	\
 	hash/md5sum			hash/sha1sum		\
diff --git a/tests/Makefile b/tests/Makefile
index 460858a..f25607b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -13,6 +13,10 @@
 CFLAGS += -g3
 endif
 
+ifdef WINDOWS
+LDFLAGS += -lws2_32
+endif
+
 APPS =	test_suite_aes			test_suite_arc4			\
 		test_suite_base64		test_suite_camellia		\
 		test_suite_cipher.aes	test_suite_cipher.camellia	\