pivot_table not working as expected when having few types of values from groupby/count
#### Code Sample, a copy-pastable example if possible

```python
import pandas as pd

raw_data = {'day' : ['Monday','Monday','Monday','Monday','Monday'], 
            'license':['A','A','B','B','B'],
            'uniqueid':[123,352,737,368,901]}
df = pd.DataFrame(raw_data).groupby(['day','license']).count()
pivot = df.pivot_table(index = 'day', columns = 'license', values = 'uniqueid')
pivot
```
Result : 
```python
         uniqueid
day             2
license         3
```
#### Problem description
This code structure returns the expected pivot table if you change, say, one 'B' license for a 'C' license. But with the data above, the numbers in the pivot table are right, but the column and index labels are not. It uses the title of the raw_data columns instead of their possible values as index/column labels.

#### Expected Output
```python
        uniqueid      
license        A  B 
day                   
Monday         2  3
```
#### Output of ``pd.show_versions()``

<details>

[paste the output of ``pd.show_versions()`` here below this line]
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.13.6-1-ARCH
machine: x86_64
processor: 
byteorder: little
LC_ALL: None
LANG: en_CA.UTF-8
LOCALE: en_CA.UTF-8

pandas: 0.20.3
pytest: None
pip: 9.0.1
setuptools: 36.4.0
Cython: None
numpy: 1.13.1
scipy: 0.19.1
xarray: None
IPython: 6.2.1
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.0.2
openpyxl: 2.4.8
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: None
lxml: None
bs4: None
html5lib: 1.0b10
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: 0.5.0

</details>
