See the question and my original answer on StackOverflow

I used the following option:

./configure --disable-cli --enable-shared 

But didn't wanted to disable threads, so, what I did is modified win32thread.c like this:

Before:

  #if HAVE_WINRT
  /* _beginthreadex() is technically the correct option, but it's only available for Desktop applications.
   * Using CreateThread() as an alternative works on Windows Store and Windows Phone 8.1+ as long as we're
   * using a dynamically linked MSVCRT which happens to be a requirement for WinRT applications anyway */
  #define _beginthreadex CreateThread
  #define InitializeCriticalSectionAndSpinCount(a, b) InitializeCriticalSectionEx(a, b, CRITICAL_SECTION_NO_DEBUG_INFO)
  #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
  #else
  #include <process.h>
  #endif

After

  #define _beginthreadex CreateThread

  #if HAVE_WINRT
  #define InitializeCriticalSectionAndSpinCount(a, b) InitializeCriticalSectionEx(a, b, CRITICAL_SECTION_NO_DEBUG_INFO)
  #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
  #endif

Basically, I replaced _beginthreadex by Windows' native CreateThread. Not sure it's a huge problem for x264, but now I can compile.